package com.zhang.satokendemo.utils;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.kafka.support.SendResult;
import org.springframework.stereotype.Component;
import org.springframework.util.concurrent.ListenableFuture;

import javax.annotation.Resource;

@Configuration
@Slf4j
public class KafkaProducer {

    @Resource
    private KafkaTemplate<String,String> kafkaTemplate;




    public void sendMsgMq(){
        ListenableFuture<SendResult<String, String>> send = kafkaTemplate.send("1", "1");
//        send.addCallback();

    }


}
